﻿<Window x:Class="SqlServerMaintenanceSolution.Views.ConnectionProperties"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
        xmlns:local="clr-namespace:SqlServerMaintenanceSolution.Views"
        x:Name="connectionProperties"
        Height="512" Width="423" Title="Connection Properties"
        WindowStartupLocation="Manual"  ResizeMode="NoResize"
        Left="350" Top="50" Icon="..\Images\TitleIcon.png">
    <Window.Resources>
        <Style TargetType="local:ConnectionProperties">
            <Setter Property="IsUseCustomColorChecked" Value="{Binding UseCustomColor, Mode=TwoWay}"></Setter>
        </Style>


    </Window.Resources>
    <Grid RenderTransformOrigin="0.577,0.414">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="241*"/>
            <ColumnDefinition Width="174*"/>
        </Grid.ColumnDefinitions>
        <Image HorizontalAlignment="Left" Height="50" Margin="10,5,0,0" VerticalAlignment="Top" Width="50" Source="..\Images\sql-server.png"/>
        <Label FontSize="18" Content="SQL Server Maintenance Monitor" HorizontalAlignment="Left" Margin="84,7,0,0" VerticalAlignment="Top" Width="292" Grid.ColumnSpan="2"/>
        <Border BorderBrush="Orange" BorderThickness="7" HorizontalAlignment="Left" Height="1" Margin="1,65,0,0" VerticalAlignment="Top" Width="415" Grid.ColumnSpan="2"/>
        <Rectangle   Margin="0,0,0,408" Fill="Gray" Opacity="0.25" IsHitTestVisible="False" Grid.ColumnSpan="2"/>
        <Rectangle    Fill="LightGray" Opacity="0.25" IsHitTestVisible="False" Margin="0,38,0,0" Grid.ColumnSpan="2"/>
        <Label Content="Type or select the name of the database for the connection." HorizontalAlignment="Left" Margin="19,79,0,0" VerticalAlignment="Top" Width="344" Grid.ColumnSpan="2"/>
        <Label Content="Connect to database:" HorizontalAlignment="Left" Margin="34,112,0,0" VerticalAlignment="Top" Width="129"/>
        <ComboBox x:Name="cbSqlServerInstances" ItemsSource="{Binding SqlServerInstances}" SelectedValue="{Binding SqlServerInstanceCompleteName}" DisplayMemberPath="CompleteName" SelectedValuePath="CompleteName" HorizontalAlignment="Left" Margin="198,113,0,0" VerticalAlignment="Top" Width="197" Height="25"  BorderBrush="White" Foreground="Black" Grid.ColumnSpan="2">
            <ComboBox.Background>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="White"  Offset="0.0"/>
                    <GradientStop Color="White" Offset="0.1"/>
                </LinearGradientBrush>
            </ComboBox.Background>
        </ComboBox>
        <Label Content="Network" HorizontalAlignment="Left" Margin="10,170,0,0" VerticalAlignment="Top" ScrollViewer.HorizontalScrollBarVisibility="Visible" RenderTransformOrigin="0.5,0.5">

        </Label>
        <Separator Margin="66,174,19,281" Grid.ColumnSpan="2"/>
        <Label Content="Network Protocol:" HorizontalAlignment="Left" Margin="34,195,0,0" VerticalAlignment="Top"/>
        <ComboBox x:Name="cbNetworkProtocols" ItemsSource="{Binding NetworkProtocols}" SelectedValue="{Binding NetworkProtocolName}" DisplayMemberPath="Protocol" SelectedValuePath="Protocol" SelectedIndex="0" HorizontalAlignment="Left" Margin="196,198,0,0" VerticalAlignment="Top" Width="197" RenderTransformOrigin="0.9,-0.128" Grid.ColumnSpan="2"/>
        <Label Content="Network packet size:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="34,223,0,0"/>
        <xctk:IntegerUpDown Name="NetworkPacketSize" Value="4096"  HorizontalAlignment="Left" Height="24" Margin="196,226,0,0" VerticalAlignment="Top" Width="55" Grid.ColumnSpan="2"/>
        <Label Content="bytes" HorizontalAlignment="Left" Margin="15,226,0,0" VerticalAlignment="Top" Height="24" Width="50" Grid.Column="1"/>
        <Label Content="Connection" HorizontalAlignment="Left" Margin="10,250,0,0" VerticalAlignment="Top" Width="80"/>
        <Separator Margin="93,253,19,202" Grid.ColumnSpan="2"/>
        <Label Content="Connection Time-out" HorizontalAlignment="Left" Margin="34,280,0,0" VerticalAlignment="Top" Height="30"/>
        <Label Content="Execution Time-out" HorizontalAlignment="Left" Margin="34,310,0,0" VerticalAlignment="Top" Height="24"/>
        <xctk:IntegerUpDown Name="ConnectionTimeOut" Value="15" HorizontalAlignment="Left" Height="24" Margin="198,281,0,0" VerticalAlignment="Top" Width="55" Grid.ColumnSpan="2"/>
        <xctk:IntegerUpDown Name="ExecutionTimeOut" Value="0" HorizontalAlignment="Left" Height="24" Margin="198,310,0,0" VerticalAlignment="Top" Width="55" Grid.ColumnSpan="2"/>
        <Label Content="seconds" HorizontalAlignment="Left" Margin="13,281,0,0" VerticalAlignment="Top" Grid.Column="1" RenderTransformOrigin="0.491,0.462"/>
        <Label Content="seconds" HorizontalAlignment="Left" Margin="13,308,0,0" VerticalAlignment="Top" Grid.Column="1"/>
        <CheckBox Content="Encrypt Connection" HorizontalAlignment="Left" Margin="34,348,0,0" VerticalAlignment="Top"/>
        <CheckBox Name="UseCustomColorCB"   IsChecked="{Binding ElementName=connectionProperties, Path=IsUseCustomColorChecked}" Content="Use Custom Color:" HorizontalAlignment="Left" Margin="34,376,0,0" VerticalAlignment="Top"/>
        <!--<Button Name="Select" Visibility="Hidden"  Content="Select..."  Command="{Binding SelectClickCommand}" Grid.Column="1" HorizontalAlignment="Left" Height="24" Margin="44,348,0,0" VerticalAlignment="Top" Width="108"/>-->
        <xctk:ColorPicker IsEnabled="{Binding ElementName=connectionProperties, Path=IsUseCustomColorChecked}" HorizontalAlignment="Left" Margin="44,376,0,0" VerticalAlignment="Top" Width="108" Height="24" Grid.Column="1"/>
        <Button Content="Reset All"  Visibility="Hidden" Command="{Binding ResetAllClickCommand}"  Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="44,388,0,0" VerticalAlignment="Top" Width="108"/>
        <Button Content="Connect" Command="{Binding ConnectClickCommand}" HorizontalAlignment="Left" Margin="59,439,0,0" VerticalAlignment="Top" Width="75"/>
        <Button Content="Cancel" Command="{Binding ExitCommand}" HorizontalAlignment="Left" Margin="148,439,0,0" VerticalAlignment="Top" Width="75"/>
        <Button Content="Help" HorizontalAlignment="Left" Margin="233,439,0,0" VerticalAlignment="Top" Width="75" Grid.ColumnSpan="2"/>
        <Button Content="Options&lt;&lt;" Command="{Binding OptionsClickCommand}" HorizontalAlignment="Left" Margin="80,439,0,0" VerticalAlignment="Top" Width="75" Grid.Column="1"/>
        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="1" Margin="10,423,0,0" VerticalAlignment="Top" Width="395" Grid.ColumnSpan="2"/>
        <Label Content="Authentication:" HorizontalAlignment="Left" Margin="34,142,0,0" VerticalAlignment="Top" Width="129"/>
        <ComboBox x:Name="cbAuthentication" ItemsSource="{Binding SqlServerAuthetications}" SelectedValue="{Binding Authentication}" DisplayMemberPath="DisplayName" SelectedValuePath="DisplayName" HorizontalAlignment="Left" Margin="198,143,0,0" VerticalAlignment="Top" Width="197" Height="25"  BorderBrush="White" Foreground="Black" Grid.ColumnSpan="2">
            <ComboBox.Background>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="White"  Offset="0.0"/>
                    <GradientStop Color="White" Offset="0.1"/>
                </LinearGradientBrush>
            </ComboBox.Background>
        </ComboBox>


    </Grid>
</Window>
